home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / shell / dialog-0.000 / dialog-0 / dialog-0.6c / samples / menubox < prev    next >
Encoding:
Text File  |  1995-08-07  |  934 b   |  34 lines

  1. #!/bin/sh
  2. DIALOG=${DIALOG=../dialog}
  3.  
  4. $DIALOG --clear --title "MENU BOX" \
  5.         --menu "Hi, this is a menu box. You can use this to \n\
  6. present a list of choices for the user to \n\
  7. choose. If there are more items than can fit \n\
  8. on the screen, the menu will be scrolled. \n\
  9. You can use the UP/DOWN arrow keys, the first \n\
  10. letter of the choice as a hot key, or the \n\
  11. number keys 1-9 to choose an option.\n\
  12. Try it now!\n\n\
  13.           Choose the OS you like:" 20 51 4 \
  14.         "Linux"  "The Great Unix Clone for 386/486" \
  15.         "NetBSD" "Another free Unix Clone for 386/486" \
  16.         "OS/2" "IBM OS/2" \
  17.         "WIN NT" "Microsoft Windows NT" \
  18.         "PCDOS"  "IBM PC DOS" \
  19.         "MSDOS"  "Microsoft DOS" 2> /tmp/menu.tmp.$$
  20.  
  21. retval=$?
  22.  
  23. choice=`cat /tmp/menu.tmp.$$`
  24. rm -f /tmp/menu.tmp.$$
  25.  
  26. case $retval in
  27.   0)
  28.     echo "'$choice' chosen.";;
  29.   1)
  30.     echo "Cancel pressed.";;
  31.   255)
  32.     echo "ESC pressed.";;
  33. esac
  34.